package com.yuyi.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class CorsConfig
  extends WebMvcConfigurerAdapter
{
  public void addCorsMappings(CorsRegistry registry)
  {
    registry.addMapping("/**").allowedOrigins(new String[] { "*" }).allowCredentials(true).allowedMethods(new String[] { "GET", "POST", "DELETE", "PUT" }).maxAge(3600L);
  }
}
